<template>
  <div>
    <div class="title_box mt-30">
      <p class="title">专利信息</p>
      <div class="line"></div>
    </div>

    <div class="mt-16">
      <a-table
        :columns="CopyrightInfo"
        :data-source="CopyrightData"
        :pagination="Copyrightpagination"
        :rowKey="(record) => record.id"
      >
        <a slot="name" slot-scope="text">{{ text }}</a>
      </a-table>
    </div>
  </div>
</template>

<script>
import { getIntellectualList } from "@/apis/com/company";
import { getCookiesUserInfo } from "@/utils/auth";
export default {
  data() {
    return {
      entId: "",
      Copyrightpagination: {
        total: 0,
        pageSize: 10,
        current: 1,
        pageSizeOptions: ["10", "20", "30", "40", "50"],
        showTotal: (total) => `共有 ${total} 条数据`,
        showQuickJumper: true,
        showSizeChanger: true,
        onShowSizeChange: (current, pageSize) =>
          this.CopyrightonSizeChange(current, pageSize),
        onChange: (page, pageSize) =>
          this.CopyrightonPageChange(page, pageSize),
      },
      CopyrightData: [],
      CopyrightInfo: [
        {
          dataIndex: "index",
          title: "序号",
          customRender: (text, record, index) => `${index + 1}`, // 显示每一行的序
        },
        {
          dataIndex: "name",
          title: "名称",
        },
        {
          dataIndex: "applicationDate",
          title: "发布日期",
        },
        {
          dataIndex: "technical",
          title: "登记类别",
        },
        {
          dataIndex: "patentNumber",
          title: "登记号",
        },
        {
          dataIndex: "registrationDate",
          title: "登记日期",
        },
      ],
    };
  },
  created() {
    this.entId = this.$route.query.id;
  },
  mounted() {
    this.getEntCopyrightPageList();
  },
  methods: {
    // 著作权信息  当前页码
    CopyrightonSizeChange(page, pageSize) {
      this.Copyrightpagination.pageSize = pageSize;
      this.getEntCopyrightPageList();
    },
    // 著作权信息   每页条数
    CopyrightonPageChange(current, pageSize) {
      this.Copyrightpagination.current = current;
      this.getEntCopyrightPageList();
    },
    //获取企业著作权信息
    getEntCopyrightPageList() {
      let _params = {
        pageNum: this.Copyrightpagination.current,
        companyId: this.entId,
        pageSize: this.Copyrightpagination.pageSize,
        type: 0,
      };
      getIntellectualList(_params)
        .then((res) => {
          console.log("企业著作权信息");
          console.log(res);
          if (res.code == 200) {
            this.CopyrightData = res.rows;
            this.Copyrightpagination.total = res.total;
          }
        })
        .catch((error) => {});
    },
  },
};
</script>
<style lang="less" scoped>
.title_box {
  border-bottom: solid 1px #ebeef5;

  .title {
    font-size: 16px;
    line-height: 14px;
    letter-spacing: 0px;
    color: #303133;
  }

  .line {
    width: 20px;
    height: 4px;
    background-color: #188af1;
    margin-top: 8px;
  }
}
</style>
